package org.example.storage.controller;

import cn.lingyangwl.framework.core.response.Resp;
import org.example.storage.service.StorageService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author shenguangyang
 */
@RestController
public class StorageController {
    @Resource
    StorageService storageService;

    @GetMapping("/storage/decrease")
    public Resp<?> decrease(@RequestParam("productId") Long productId , @RequestParam("count") Integer count)  {
        storageService.decrease(productId,count);
        return Resp.ok("扣减库存成功");
    }
}
